package com.shushan.accessibility;

import android.os.Bundle;
import android.os.PersistableBundle;
import android.support.annotation.Nullable;
import android.view.View;
import android.widget.Button;
import android.widget.ImageView;

import com.shushan.base.BaseActivity;
import com.shushan.base.ScreenManager;
import com.shushan.shushanbao.R;

/**
 * @ClassName: PermissionAccessOpenActivity
 * @Desciption: 开启辅助功能
 * @author: yichaohua
 * @date: 2018-07-17
 */
public class PermissionAccessOpenActivity extends BaseActivity implements View.OnClickListener {

    private static final String TAG = "PermissionAccessOpenActivity";

    private Button openButton;
    private ImageView backImg;


    @Override
    public void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        setContentView(R.layout.permission_access_open_activity);

        ScreenManager sm = new ScreenManager();
        sm.setDeepStatusBar(true,this);
        initView();
    }

    private void initView() {
        openButton = findViewById(R.id.access_open_btn);
        openButton.setOnClickListener(this);
        backImg = findViewById(R.id.actionbar_left_back_img);
        backImg.setOnClickListener(this);
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()){
            case R.id.access_open_btn:
                OpenAccessiSettingHelper.jumpToSettingPage(this);
                onBackAction();
                break;
            case R.id.actionbar_left_back_img:
                onBackAction();
                break;
            default:
                break;
        }
    }
}
